<?php
namespace app\service;
use think\facade\Db;
class appletService{
	public function community(){
		//return Db::table("room")->where("community_name","香悦郡国际公寓")->distinct("community_name")->column("community_name");
		return Db::table("room")->distinct("community_name")->column("community_name");
	}
	public function usercommunity($user_id){
	    
	}
	public function disgroup($community_name){
		return Db::table("room")->where("community_name",$community_name)->distinct("group")->column("group");
	}
	public function disbuild($community_name,$group){
		return Db::table("room")->where("community_name",$community_name)->where("group",$group)->distinct("building")->column("building");
	}
	public function disunit($community_name,$group,$building){
		return Db::table("room")->where("community_name",$community_name)->where("group",$group)->where("building",$building)->distinct("unit")->column("unit");
	}
	public function disroom($community_name,$group,$building,$unit){
		return Db::table("room")->where("community_name",$community_name)->where("group",$group)->where("building",$building)->where("unit",$unit)->distinct("room")->column("room");
	}
}